3.619 \(\int \frac{a^2-b^2 \cos ^2(c+d x)}{a+b \cos (c+d x)} \, dx\)

Optimal. Leaf size=16 \[ a x-\frac{b \sin (c+d x)}{d} \]

[Out]

a*x - (b*Sin[c + d*x])/d

________________________________________________________________________________________

Rubi [A]  time = 0.045377, antiderivative size = 16, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 30, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.067, Rules used = {3016, 2637} \[ a x-\frac{b \sin (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[(a^2 - b^2*Cos[c + d*x]^2)/(a + b*Cos[c + d*x]),x]

[Out]

a*x - (b*Sin[c + d*x])/d

Rule 3016

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Dist[
C/b^2, Int[(a + b*Sin[e + f*x])^(m + 1)*Simp[-a + b*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, C, m}, x
] && EqQ[A*b^2 + a^2*C, 0]

Rule 2637

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \frac{a^2-b^2 \cos ^2(c+d x)}{a+b \cos (c+d x)} \, dx &=-\int (-a+b \cos (c+d x)) \, dx\\ &=a x-b \int \cos (c+d x) \, dx\\ &=a x-\frac{b \sin (c+d x)}{d}\\ \end{align*}

Mathematica [A]  time = 0.0096987, size = 28, normalized size = 1.75 \[ a x-\frac{b \sin (c) \cos (d x)}{d}-\frac{b \cos (c) \sin (d x)}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[(a^2 - b^2*Cos[c + d*x]^2)/(a + b*Cos[c + d*x]),x]

[Out]

a*x - (b*Cos[d*x]*Sin[c])/d - (b*Cos[c]*Sin[d*x])/d

________________________________________________________________________________________

Maple [A]  time = 0.025, size = 22, normalized size = 1.4 \begin{align*}{\frac{-\sin \left ( dx+c \right ) b+a \left ( dx+c \right ) }{d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a^2-b^2*cos(d*x+c)^2)/(a+b*cos(d*x+c)),x)

[Out]

1/d*(-sin(d*x+c)*b+a*(d*x+c))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a^2-b^2*cos(d*x+c)^2)/(a+b*cos(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.31461, size = 38, normalized size = 2.38 \begin{align*} \frac{a d x - b \sin \left (d x + c\right )}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a^2-b^2*cos(d*x+c)^2)/(a+b*cos(d*x+c)),x, algorithm="fricas")

[Out]

(a*d*x - b*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [A]  time = 0.800864, size = 32, normalized size = 2. \begin{align*} \begin{cases} a x - \frac{b \sin{\left (c + d x \right )}}{d} & \text{for}\: d \neq 0 \\\frac{x \left (a^{2} - b^{2} \cos ^{2}{\left (c \right )}\right )}{a + b \cos{\left (c \right )}} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a**2-b**2*cos(d*x+c)**2)/(a+b*cos(d*x+c)),x)

[Out]

Piecewise((a*x - b*sin(c + d*x)/d, Ne(d, 0)), (x*(a**2 - b**2*cos(c)**2)/(a + b*cos(c)), True))

________________________________________________________________________________________

Giac [B]  time = 1.35752, size = 53, normalized size = 3.31 \begin{align*} \frac{{\left (d x + c\right )} a - \frac{2 \, b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 1}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a^2-b^2*cos(d*x+c)^2)/(a+b*cos(d*x+c)),x, algorithm="giac")

[Out]

((d*x + c)*a - 2*b*tan(1/2*d*x + 1/2*c)/(tan(1/2*d*x + 1/2*c)^2 + 1))/d